﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ChooseCourseType.aspx.cs" Inherits="WirtualneNauczanie.Web.ChooseCourseType" MasterPageFile="~/Default2.Master" %>

<asp:Content ID="MainContent" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<h1>Wybierz kurs, który chcesz studiować.</h1>
    
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:BazaDanychSqlConnectionString %>" 
        SelectCommand="SELECT * FROM [Courses]"></asp:SqlDataSource>    
    
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:BazaDanychSqlConnectionString %>" 
        InsertCommand="INSERT INTO StudentsCourses(StudentCourseID, CourseID, DateEnrolled, StudentID) VALUES (@StudentCourseID, @CourseID, @DateEnrolled, @StudentID)" 
        SelectCommand="SELECT MAX(StudentCourseID) AS Expr1 FROM StudentsCourses">
        <InsertParameters>
            <asp:Parameter Name="StudentCourseID" />
            <asp:Parameter Name="CourseID" />
            <asp:Parameter Name="DateEnrolled" />
            <asp:Parameter Name="StudentID" />
        </InsertParameters>
    </asp:SqlDataSource>
    <p>
        <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
    </p>
    <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Zapisz się" />
    
    <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</asp:Content>
